import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:lovify/models/enums/relationship_status.dart';
import 'package:lovify/models/user.dart';
import 'package:lovify/screens/tabs/chat/love_chat.dart';
import 'package:lovify/screens/tabs/chat/single_chat.dart';
import 'package:lovify/state/user_controller.dart';

class ChatTab extends StatefulWidget {
  const ChatTab({super.key});

  @override
  State<ChatTab> createState() => _ChatTabState();
}

class _ChatTabState extends State<ChatTab> {
  final _userState = Get.find<UserController>();
  @override
  Widget build(BuildContext context) {
    User u = _userState.user.value;
    if (u.relationshipStatus == RelationshipStatus.single) {
      return SingleChat(user: u);
    } else {
      return LoveChat(user: u);
    }
  }
}
